Skip to content

Conversation

@gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Jan 12, 2026

The basics

The details

Resolves

Proposed Changes

This PR cleans up Zelos' display of proposed connection indicators. Previously, proposed input connections indicators had three possible appearances:

Screenshot 2026-01-12 at 3 06 10 PM (2)

Fuzzy, when an existing block would be replaced

Screenshot 2026-01-12 at 3 06 04 PM (2)

Normal, when a block would be connected to an empty input

Screenshot 2026-01-12 at 3 05 59 PM (2)

Skinny, same circumstances as above but when the highlight ring happened to be z-ordered below the fill for the input slot.

Likewise, next/previous connection indicators could appear normal, or partially obscured by the insertion marker depending on the whims of z-ordering:

Screenshot 2026-01-12 at 3 07 12 PM (2) Screenshot 2026-01-12 at 3 07 09 PM (2)

Now:

  • The "replacement fade" (fuzzy) filter has been entirely eliminated; the connection highlight for replacing a block appears the same as the highlight for inserting a block into an empty input connection
  • Connection highlights are always brought to the front, so the skinny/obscured appearances are eliminated. This also normalizes them and makes them consistently prominent for Geras/Thrasos.
  • Input connection highlights are shown in Zelos on both the dragging and stationary block, as appropriate; previously, if the block being dragged was aligned in such a way that it was eligible to connect to an input on a stationary block, there was no visual indication of this.
  • BlockSvg.highlightShapeForInput() has been removed, as it was internal and had no callers.

Breaking Changes

  • REPLACEMENT_GLOW_COLOUR, REPLACEMENT_GLOW_SIZE, and replacementGlowFilterId have been removed from Blockly.zelos.ConstantProvider. References to these fields should be removed; the appearance of the connection indicator can be styled with CSS targeting .blocklyHighlightedConnectionPath.
  • IPathObject.updateReplacing() has been added; this method is optional and the root PathObject defines it by simply toggling a class, so this should not strictly be breaking, but custom renderers may wish to implement/override it.

@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Jan 12, 2026
@gonfunko gonfunko changed the base branch from main to v13 January 13, 2026 23:14
@gonfunko gonfunko changed the title fix: Normalize Zelos connection indicators fix!: Normalize Zelos connection indicators Jan 13, 2026
@github-actions github-actions bot added PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Jan 13, 2026
@gonfunko gonfunko marked this pull request as ready for review January 13, 2026 23:24
@gonfunko gonfunko requested a review from a team as a code owner January 13, 2026 23:24
@gonfunko gonfunko requested review from BenHenning and removed request for a team January 13, 2026 23:24
@BenHenning
Copy link
Collaborator

BenHenning commented Jan 14, 2026

I haven't looked at this in depth quite yet, but how are highlights now consistently brought to the front to fix the z-ordering issue, and does this introduce any problems with keyboard navigation? I remember digging into this before and I found that the standard bringToFront will break focus since it changes the DOM and many DOM operations just completely reset focus back to the document body. I think we built some resilience to this failure type in places (and maybe in FocusManager itself) but I would need to dig to confirm.

Edit: Ah, #8981 was the one that may have made this work. I'm still curious about the first part, though, because I don't see bringToFront used anywhere.

Copy link
Collaborator

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than my specific concerns on focus this seems like an excellent simplification.

const highlightSvg = this.findHighlightSvg();
if (highlightSvg) {
highlightSvg.style.display = '';
highlightSvg.parentElement?.appendChild(highlightSvg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might cause focus loss problems. I'm also curious why this is necessary--shouldn't the highly SVG already be properly parented since it exists in the DOM at this stage?

Or is this the means to try and 'bring it to front'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the means to bring it to the front. Experimentally, there don't appear to be any focus issues, I think because the highlight SVG is not itself the thing that has focus; I was able to move blocks using keyboard nav and Zelos and it behaved as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug

Projects

None yet

3 participants